package com.sqsf.service.impl;

import com.sqsf.javabean.Video;
import com.sqsf.mapper.VideoMapper;
import com.sqsf.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class VideoServiceImpl implements VideoService {
    @Autowired
    VideoMapper videoMapper;
    @Override
    public List<Video> findAll(int tid) {
        return videoMapper.selectAll(tid);
    }

    @Override
    public void add(Video video) {
        videoMapper.insert(video);
    }

    @Override
    public void delete(int id) {
        videoMapper.deleteById(id);
    }

    @Override
    public void deleteList(List<Integer> ids) {
        videoMapper.deleteList(ids);
    }

    @Override
    public Video findById(int id) {
        return videoMapper.selectById(id);
    }

    @Override
    public void edit(Video video) {
        videoMapper.update(video);
    }
}
